package com.bb.blog.biz.manage.constant;

import com.bb.blog.web.constant.ServerExceptionEnum;
import org.springframework.http.HttpStatus;

public enum ManageExceptionEnum  implements ServerExceptionEnum  {
    /**
     * 菜单
     */
    MENU_CODE_DUPLICATED(400,"菜单code重复", null),
    MENU_PARENT_NOT_EXISTS(400, "父级菜单不存在",null);




    private String msg;
    private Integer code;
    private Object data;

    ManageExceptionEnum(HttpStatus httpStatus) {
        this(httpStatus.value(), httpStatus.getReasonPhrase(), null);
    }

    ManageExceptionEnum(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public Object getData() {
        return data;
    }
}
